cleaned up some code and commends