two phase procedure