updated file reading, fixed comments