some kind of sort with various complexity