replace readlines() with lines()