Added some more date handling code