for loop works