adding WS4D code