Fix cube example.
Cleaned up the cube example and added documentation for it.