Modify sortWorkfaces method in SortTool class