made statistics more efficient