Implemented reading from file at once.