Repaired "middle pair" rule condition
Tidied code alignment & simplified comment