Made number rewriting better