Temporary changes to correct errors in the detectWords method.