partially revert change to readlines