more elaborate example, plus a useful shell script