1.2.2-8 (Add notes and javadocs,Remove some var) [Use less memery]

1)Add notes and javadocs
2)Remove some var(Use less memery)
3)Update Algorithm