changed from readlines() to readline(), should save a little memory, performance seems the same