add average length field