Date check implemented
Added some comments