cleaned up draw function