changed all applicable loops' breakout condition to numOfWords instead
of wordSet.length