fixed bug in auto-set, removed lots of comments.
Fixed another bug in auto-sort
Fixed another bug in auto-sort
Final fixes for auto-set