changed count_parens from fn to closure