implemented Animal nested comparator