checkMiddle -method extracted.