(function() {
  function shiftImage(dir, amt) {
    var pos;
    if (dir == "lr") {
       pos = parseInt(theImg.style.left);
       pos += amt * 5;
      theImg.style.left = pos;
    }
    else {
      pos = parseInt(theImg.style.top);
      pos += amt * 5;
      theImg.style.top = pos;
    }
  }
  
  function keyCheck(e) {
    if (e.keyCode == 37) {
      shiftImg("lr", -1);
    }
    else if (e.keyCode == 39) {
      shiftImg("lr", 1);
    }
    else if (e.keyCode == 38) {
      shiftImg("ud", -1);
    }
    else if (e.keyCode == 40) {
      shiftImg("ud", 1);
    }
  }
    
  var theImg = document.getElementById("shiftyImg");
  if (theImg) {
    console.log(theImg);
    theImg.style.left = "0px";
    theImg.style.top = "0px";
    document.addEventListener("keydown", keyCheck);
  }
  console.log("hi");
}).call();

@@ -7,16 +7,30 @@
 ion() %7B%0A
+  var theImg;%0A
   functi
@@ -330,24 +330,63 @@
 yCheck(e) %7B%0A
+    if (!theImg) %7B%0A      return;%0A    %7D%0A
     if (e.ke
@@ -628,19 +628,42 @@
 %7D%0A  %7D%0A  
+%0A
   
-%0A
+function grabImg() %7B%0A  
   var th
@@ -707,16 +707,18 @@
 yImg%22);%0A
+  
   if (th
@@ -731,31 +731,8 @@
 %7B%0A  
-  console.log(theImg);%0A
     
@@ -758,24 +758,26 @@
  %220px%22;%0A    
+  
 theImg.style
@@ -792,16 +792,219 @@
 0px%22;%0A  
+    return true;%0A    %7D%0A    return false;%0A  %7D%0A  %0A  function grabImgLoop() %7B%0A    if (!grabImg()) %7B%0A      setTimeout(grabImgLoop, 10);%0A    %7D%0A  %7D%0A  %0A  if (!grabImg()) %7B%0A    setTimeout(grabImgLoop, 10);;%0A  %7D%0A
   docume
@@ -1051,30 +1051,8 @@
 ;%0A  
-%7D%0A  console.log(%22hi%22);
 %0A%7D).

Update moveImg.js