add preview function (string in, string out)