Added some comments, removed unused code.