fixed issue #20
fixed issue #19
working on issue #8
working on issue #8