Added and updated comments, documentation and TODO's.