Added braces swap functionality