fixed typos in visualize function