replacement logic 2