Added some comments and renamed a couple things.