modified runphc3d a little, doesn't work anymore for M = N