Update boxes array to 2d array with object and make clicking work