Added saving of parameters