alter main simulation loop in an attempt at optimization