added a somewhat working time period functionality with tests