Added and fixed functionality for drawing.