updated balancer script