Added modified visualization code