Much work on input validation