bug fixes, was not saving data. Improved doc (not done)