chaned where gradient is written
added new finalize options
added migration workflow