update number logic