Debugged and organized output. Currently exiting before trying to make the 3d plot, as that was taking too much time with the dataset I'm working with atm.