debugged measure_features