sorting output statements and adding ComparableSet