added some javadocs and examples