added phi-replace