Experimenting with thread, which may not work with P2D