ex 5.10 done

without input control