finished implementation of the cube in c