implement ex2.6
merged