working sorting method

Signed-off-by: Youngcraiger <duglescrig@gmail.com>