Change for loop with foreach to work directly with array keys