Added scoring functions to views.py