SAMPLE PROGRAM CODE Note: This is intended as one example of use. It is not optimised for speed or memory.