Changed a few things to fix the plot