modified monthdelta function