Added licensing information and code comments.