Fix Structure Script bug, clean code and add cricle test.