Compare method with new class

continued with compare method and created new private class.