position should be 0-indexed