added for loop for building rank of all hospitals in a state