implemented issue #30
checked issue #32