cleaned up some code and commented a bit
cleaned up some code and commented a bit