Edge condition is incorrect. Loops indefinitely.