added break to exit each loop early if a non matching letter is found