write to file. project is complete(though with a few bugs)