Swapped struct for typedef in for loop