add order stats function