Updates to save function