stats final code