Renamed some functions. Added infile parsing function