Modified code so that NDD that fall on the 1st of the month are recognised.