added line generating function