Code samples from the book since the book was written poorly and the examples don't work as entered in book