fixed issue 1 & issue 3
fixed issue 2 & 4
Merge pull request #16 from torifat/master

fixed issues