updated conditional statements

would skip a space. 
should be minx/y + i <= maxx/y