Note: This is not the main code sample. It is a modified version of the original to accompany this wiki article. Find out more about the original code sample here.