Created selectWord Function