added stuff to make view.py shorter

as requested