Fixes iterator bugs
Now the pray function in the header