added javadoc

some things still needs fixing, but overall, almost everything is done.
JUnit tests are still waiting to be made.