added visualize_target function