simulateBuy performance issue fix

Should be fast enough now.