rewrote inttoBCD