#1 added timebucket logic.