Averaging and metadata now working.