commented and optimized loadbalance