Changed variable names in the save function.