added function to render visualization