sml code should be modified. ruby is not finished.