some cleanup and added scope arg to mod_for_derivs
interim