Added helper method for line drawing.