Some code snippets written during study.