Look at the example in the manual.