Trying to get the view function right