Huge modification of program structure, add comment for javadoc, add doc of javadoc