Moved stuff around, added some comments