modified for Standard ML quickrun.