converted part of pause based algorithm