Also be sure to format your code according to the FAQ. When you are posting, there is an icon at the top that looks something like this:
Click on it and then copy-paste your code.
hero.say("You'll get something like this.")
hero.say("Of course, your indentations will still appear.")
Did you call cleaveWhenClose(target) in the loop?