add ex 1.23 solution and explaination