Code Rebase

Rebase to the lastest code.