begun to implement graph based balancing