Added some stuff to calculate date