Implemented best and rankhospital functions