fix code styling for PEP8
add docstring for view