added javadoc and support for rollback