testing sort function