added saving (not tested)