cleanup and javadoc
add samples to test directory