sfromq function

s from q