updates to stats code