Added some comments, reorganized stuff