started fixing some of the variables, and even added some comments