added functions from professor
attempted to do date sort