finished rankhospital.R of assignment3