cleaned up date code