Previously the start index was incorrect. Adding comments where I was double-checking things along the way.