Main code added.

Using the code from tutorial. http://wp.me/pQmjR-1Z5 (Example 42.4)