reformatted the halfway line drawing code