Altered stripOrder function to use callback function to sort dates or other custom values