worked visualization code