Added better find function.
Fix for simulation function.