Update stats.php

Added functionality to original function to allow avg coins