added count () as requested in exercise 4 and tested it in hospital