Added javadocs
It will make working on this easier. If you know what some functions do,
add a description.