made some changes to dynamic balancing still under testing