Added @Javadoc and comments