New save function.