Added view as HTML function