The generateIntervals() method is now working, more or less.