change to pdawson's better code
added tests for each axis using a simple 3d cube.