retab function