implemented sort method for tests