Updated javadocs and junit tests