edits for contractive, running but giving nans