Cleaned up index accessor in script. Was thinking like a C# programmer