nit: if (moved != true) => if (!moved)