added the sort function

Signed-off-by: tanji <nicholastanjerome@gmail.com>