You may check your formula by running ``sch.m'' and then typing W'*O(W), which should now be the identity matrix (to within machine precision).