sample code from the cfoo