Merge pull request #9 from pkathail/master

Fixed issues 4, 5, and 6
Merge pull request #10 from pkathail/master

Fixed issue 7
Fixed issue 1