Now writes data to a specified file
Fields are now pulled from a data file