Wrote line drawing function