moves drawing code into its own function so it is compartmentalized for re-drawing/animation.