move position function made with C