Merge into single file, clean up for pedagogical purposes.