added saving to file
made a better example, fixed loading