Something happened with my rating which I cannot understand. I gave a contest and my rating increased by +135 (1012 -> 1147). But in the next contest I performed poorly, and my rating decreased by -94 (1127 -> 1033). Yes, that's not a mistake, after giving the second contest, the rating change for previous contest changed to +115 (1012 -> 1127).
Can someone please explain why and how this happens?
What are the factors on which rating change for a contest is decided?