Start to implement interval-based hierarchy builder