Added javadoc and some method body