Added some comments, cleared out old commented code, and fixed a few minor bugs.