implemented commit phi function