Fixed the drawing function to be regex