Fixed #10.
Also Added more javadoc.