Fixed for loop dimensions in object creation