for-loop fixes speed