@valera-rozuvan The 'figureOutStartEndTime' function is unnecessary, it is always called just before 'figureOutStartingTime'. You can put its body at the beginning of 'figureOutStartingTime'. Not only will it be less confusing, it will also make sure that we have valid 'startTime' and 'endTime' before we return a value for 'time'.