some small mods to derivatives