calc w0 and w