have the sumlevel function return the depthTotal rather than printing it

Then at the place where you now call the initial sumlevel, use this return value to print it out.