Rewrite to reflect new legIK logic