more psudocode for power accum. and bucket detection