Fix off by one bug
Need to declare dx and dy