How the Sample Program works