added test for sorting