Added some comments; cleanup a little.