First draft and test of compareGrids + supporting functions written