line number reduction (loops for all directions)
reduced number of lines