added input checking
Merge pull request #205 from rkmaddox/inputcheck

added input checking