tightened modifiers and added javadoc