added stop behaviour plus javadoc and license info