Tidied up and added more comments to examples