write getPartialWordList func