Added comparison method for Grid, to enable the use of set