second version of implementing issue #9