fixed the self-assignment and linked list order problem of TreeMap