Revised structure and more documentation.