added some comments/documentation.