implement better drawing
optimize nextState() calculation