fixed bug with WIF calculation.