remove dead code, add in balance and unbalance functions