modified by prof JYY