changed visualization code