updated Grid.java for SDK 1.7 compliance