Added codes. by xuruiqi