i wonder if it would be more efficient to extract features during the first loop... but that woudl mean weird weird things for the data