added last test file cube.c and made others work by fixing a lot of bugs in hierarchy.c