added drawLine() function to all cases.