I think the code in the loop would read better is it were ```coord, dim``` here?