Corrections and cleanup

Sorry about all the reformatting but I was having a hard time reading it bc it wasn't lined up correctly, and also I'm a bit OCD about clean code.