Rejiggered save function