v1 of the final program, need test