refactored rendering code to fix bug on changing cube size
added reset feature with escape key