Added moveToPos function.