issue #9, #10, #11 fixed