initial s2w dt2w code import from @showp1984

Signed-off-by: Paul Reioux <reioux@gmail.com>