Minor modifications and add documentation.