fixing array initializing code