added counter of animals, refactored work with background thread