adding more docs for nested methods
added multiple train methods for java compatability