Simplified calculating local and global metrics by adding a utility class for grid squares. #64