factorize position algorithme