completed ex 6.1
working of 6.2