Worked on view function.