implement ex2.6