Modify zhen's method