changed a lot of code, dynamic parameters for directory now extends to reading and writing to file as well