Still using 1-indexing here. We need to ensure that we are using 0-indexing whenever possible.