Make the code way clearer. Do not draw outside the window.