ai balancing
code cleanup