add function to count closse paranthesis