Simplified the interval calculations