sorting of contexts