Wrote the view functions