Use integer indices instead of coord pairs for performance reasons