made printAnimal function and used it