* first implementation for sort method