rankhospital.R has choosen hospitals with specified ranking but I want to refine the code so there is less redundancies