main file with input validation