Fix Bug: segmenatation fault by error parameter; Add function: get best pair by statistic parameter