finish and add javadoc