made line drawing more modular
start of transition to chris's code