Fsm counter

Pull the counter revision into master.