auto parens rebalancing and added new tests