xchange number with length of table