Implemented W table computation and toDecimal function.