Shixing develop

I added some docs and comments to explain the code and algorithm.