Changed from line by line to reading entire file in one go should be faster on AWS?