Added time-bucket code, still requires a proper interface.