mods to res_rot and dBres funcs