Added generic interval calculations