Reduced Flickering

Changed paint behavior to reduce flickering. Also fixed a bug were the
canvas would get messed up when the window is resized.