move cube drawing code into cube class