invalid index error which i dont understand - C#