fixed the date bug and also include the calculation of the final counter