off topic: to avoid allocations we may want to run through the entire codebase and replace iterator loops with indexed loops wherever doing so is safe