Added getWords method