added sortby question and non-trivial test case