optimized drawing a bit. no memory leaks until a certain point, then it hangs.

still hangs after some time