added reg code