Updates to views.py

Added some comments and removed some old code.