add ber functions