Code from the first chapter