finished rankhospital function