Revised W3 code