updated hour range calculation