Array loop first element goes last?

I’m making an array filled with some gameObjects all tagged as “Spells”.
What is happening is that always the first element is shown last when iterating through the array.
Here is the code:

var Pre_Spells : GameObject[];

private var i : int = 0;
private var item_pos : int = 0;

function Start() {
   fillArray();
}

function OnGUI() {
   for(i=0; i<Pre_Spells.length; i++) {
      GUI.Box(Rect(5,35+item_pos,390,250), GUIContent(Pre_Spells<em>.GetComponent(Spell).Spell_Name,Pre_Spells*.GetComponent(Spell).Spell_Icon));*</em>

if(GUI.Button(Rect(5,200+item_pos,150,50), “Check”)) {
Debug.Log(i);
}
item_pos = 250 * i;
}
}

function fillArray() {
Pre_Spells = GameObject.FindGameObjectsWithTag(“Spells”);
}

So, for example, Pre_Spell is filled like this:
Pre_Spell[0] = spell0
Pre_Spell[1] = spell1
Pre_Spell[2] = spell2
But when iterating the array it shows
spell1
spell2
spell0 → it was the first element, but shown last!
The gui.button “check” actually shows the correct array position.
Is this a normal behaviour? Am i doing something wrong?
any help is much appreciated.

Ok, after testing a lot, the problem wasn’t in the loop, but in the item_pos variable…

So now it works perfect, the final code:

var Pre_Spells : GameObject[];

private var i : int = 0;
private var item_pos : int = 0;

function Start() {
   fillArray();
}

function OnGUI() {
   for(i=0; i<Pre_Spells.length; i++) {
      item_pos = 250 * i; //the right place for this
      GUI.Box(Rect(5,35+item_pos,390,250), GUIContent(Pre_Spells<em>.GetComponent(Spell).Spell_Name,Pre_Spells*.GetComponent(Spell).Spell_Icon));*</em>

if(GUI.Button(Rect(5,200+item_pos,150,50), “Check”)) {
Debug.Log(i);
}
//item_pos = 250 * i; was here before and made first element appear last
}
}

function fillArray() {
Pre_Spells = GameObject.FindGameObjectsWithTag(“Spells”);
}
I’m so sorry I opened a question here and discover my stupid error…
thanks anyway for everyone who read this or those who tried to help.