cleaned up some code and made it easier to draw text