new algo changes for dates