twi reg calculations