Detect more square patterns

As the one found in the benchmark `slowparts.py'
I don't understand the comment you want me to add :-/