Moved resize out of repaint loop to optimize
Random changes to input handling and rendering