Added file reading & writing

Contains interesting bug that propogates file values to incorrect
locations.