Synapse (www.synapse.org) demo script and supporting functions