add ex2 source code