Working non-iterator version of code without aliasing