Have changed in the method Turn using endswith istead of nameArray.