Some progress towards Issue #3
refactored validating method

I hadn't realized there were so many corner cases.