improved interval calculations