Finish draft code for first chapter