Annotated source, fix bugs in example, add example file.