first iteration of ordenation