Added error checking on number of words input