change of variable names
corrected off-by-one error in windows0() and windows(), they were stopping before the final row and column of the image