Worked on removing global variables and migrating code to the new X3D cube and object structure