Changed unsorted class and equals method in abstract