added all the code

javadocs is not edited