finish ber functions