All code snippets from the "Programming = ++ Algorithms" book (http://www.programirane.org/)