Added lag average calculation