movement using the arrows were not functional

may be it is because of the misplaced for-loop ending, the movement
table with action listener were not available in DOM.