fix diagonal possible moves by adding row number limit to loop