modified to use date