Updated TODO doc, added comment to some code