Updated code

Fixed a few things to bring it up to date and added code comments in the canvas example.