source code from episode 6 of CodexCasts