This code is for research.