using variables as intervals