Fixed cubeAt to work for any depth + minor style changes

Still would like a formula for calculating the final number of floats
needed so the array doesn't need to be resized part way through
construction