Added timestamps logic plus functions