update defaults and add gradient