updated routing algorithm to use new role constants