sort function for tweets