Made type Node implement Comparable to avoid creating anonymous class.