#184 use average between max and min values for peaks instead of max