Add average line functionality