Added support for odd rows/columns. This version has no row or column permutation restrictions, and still works for up to 14x14