copying the example code from http://www.ibm.com/developerworks/library/l-guile/