Added tests for sorting