New version after add Enwei's work