minor changes to the interval function