Rewrote the draw function, works much better.
cleaned up comments.