added callback function to sort function, but still stuck on using key to sort the array objects.