more efficient loops