* refactored to do field validation with pattern matching instead of nested case statements, added simple test script