modified the grid quality calculator to do nearly the same thing with less math