p. 78, sum over cubes of x (just for completeness, this function pretty much sucks