added saving functionality (no error handling)