removing extra loop to match open and closed symbols