Added licensing information and code comments.
Added more code comments.