Essentially working (count, ai, ao, trigger)