Out of Memory Fix

Added a loop for high iteration searches.