Added ping pong buffer technique, which allows threaded iteration of 2D stuff.