Q: How can we count the sites in "/cam8/demos/polymer/double-space.exp" experiment which have the bits "monomer0" and "monomer1" both set? Does the fact that the experiment uses a macro-step cause a problem? A: The easiest way to count things is usually just to change the rule you're running to put the thing you want to count in some spare bits in the cell. For example, define 15 15 == monomer-pair : pair-count-rule monomer0 monomer1 + 2 = -> monomer-pair ; Bit 15 is not used by this experiment to store any state information in the cell, so it is available to hold a flag marking the sites with two 1's in the monomer bits. If you add this line at the end of "poly-rule" and recompile the rule tables (i.e., use "0l" to load the experiment), then you can see the count you want using the "=" key in the key-interpreter and looking at the last count. You could also print out just this count after each display by adding : print-monomer-count *count* monomer-pair field count-field ." Count = " . cr ; ' print-monomer-count is after-display at the end of the experiment. Note that your concern that the "macro-step" will somehow cause a problem is unwarranted. The macro-step is only used to speed up execution when you're running long sequences of steps between displays. If you set things to display every N steps (using a numeric argument to Space or Return in the key interpreter, or an argument to the function "steps/display" in your program), then "print-monomer-count" will also be run every N steps. If you didn't have any spare bits in the rule, or you didn't want to change the rule, you could define a completely separate routine to do the counting. In this case, we again define "pair-count-rule", but don't change "poly-rule". Our analysis printing routine has to do a little extra work instead. The following code can be put into a separate file, (say, "mon-count.aux") and loaded after you load the unmodified "double-space.exp" demonstration experiment: 15 15 == monomer-pair : pair-count-rule monomer0 monomer1 + 2 = -> monomer-pair ; create-lut pair-count-lut ?rule>table pair-count-rule pair-count-lut : print-monomer-count lut-data pair-count-lut switch-luts *count-lut* when-starting monomer-pair field count-field ." Count = " . cr ; ' print-monomer-count is after-display Now, "print-monomer-count" uses a lut to do the the counting, and then prints the result. The output of the "pair-count-lut" is sent by *count-lut* directly to the event counters, and doesn't change any cell bits. We execute "when-starting" after *count-lut* because we changed the lut data, and the convention is that "when-starting" sets this information up again. In fact, in this example, since the rule only uses one table, we could have just switched back to the previous lut using "switch-luts", but we wanted to make the example more general.