Added some comments, cleaned up some debugging ifs.