May or may not be done

I have the nested for loops to check for the dx and dy, but no idea as
to whether it works.