adding backtest and stats function