Updating TreeSet to use inheritance