rewrote var counts method for speed for simulations