Averaging added to library.