fixed issue 23
fixed issue #22
fixed issue #21