Changed addWords to make it more efficient. Direction is based on -1,0, or 1 instead of letters.