fixing a bug with the file writer and updating README