Added logging to improve slow solutions.