First version of the program, filled in stubs from Peng.