grid Algo.java

fixed