classifyIntervals and avgInterval out of class