fixed and tested BCDtoint