adress review comments; add javadoc