Fixing matching_brackets() Function