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

Fixed issues 4, 5, and 6