improve magic opening square bracket for for/fold