Added date processing code