Finished rankhospital function