added code that was broken out of main rhizome.org repo