working issue #19 and issue #20