Nice.  This is the bit I didn't think of, when I punted and just hacked up the sample Activities.