working toBinary and toDecimal