fixing some of my noob mistakes/ cleaning up some code