rearranged account date logic