Added check to ensure a valid number of words is supplied, changed solve methods if statement back to a switch statement