Add logic of time periods