Added word selection function