added recording of random phase