moved true peak calculation to separate branch