issues #3, #5 fixed