starting index should be 0