Adding basical lexigraphical sorting of rows/columns. This does not sort rows/ columns which contain the same amount of 1's. This solution can solve 14x14, but not 16x16