Removing temp for each loop in visualizeSGP