I think I fixed some bugs dealing with proper assignment of bPos and link for the highest ranked patient but there is still an issue where ranking seems to be off by 1