added choice to average or not in rbaMeasurement