Changed to use intervals.