finisehd debugging rankhospital, and separated it into new file