Added compChooseWord function