Create S-matrix