ran tests, found and fixed bug. Updated documentation.