newer version of views.py