Second Commit

Added javadoc and cleaned  code a little