See the examp1-3 directory for example 8.