add rep function