Minor implementation changes. Documentation added.