add source code for part 7.2 (not tested)