improved itoa function