added row and column positions of the windows, but the algorithm is slooooow...