updated scripts to read and write to appropriate places