Registered updateCubeSize with the window Event Listener and removed window.onload / onresizefor assignment for consistency.