improving the interval detection