created a class to write and save files, added comments