functional lazy version with aggregate scoring