Implementing Comparable to class encounter.