faster without for-loop on generator