correct rotate of a pulsar, also added detune function