add ex3 and various tests for ex2