work on time period calculation