updated view function