add select words function