merge with Lai's version
Revert "merge with Lai's version"

This reverts commit 61712f3e2f97122a3bfdf6d46b99a25307346a17.