adding stats func > app/views.py