Validation of text

Apart from rejecting blank inputs, this basically fills the requirements for the assignment. I would like to preserve it in case future modifications break it.