Example1

Added example 1, javadoc and some fixes