added test and fixed arbitrage bug