Added documentation from the Java version