Removed selection by tileID and added JS for arbitrary sized grids