stat logic