add search and view code