ex2 update code