Updated the file reading and datastructures.