view function