piece moving logic improved