(Working) code snippets from books