This commit includes final version of the code and doc.

This commit includes final version of the code and doc.