cleaned up some comments and changed some code