Added primitive version of balance()