put phase1 before row rank calcuation again