added javadoc, properly implemented interrupt