manually iterate through the lines vector