s2d: Initial logic coding.