rewrite xtoa