I have been out of touch with Algorithms for a while and have start revising my concepts these days. To my surprise the last i remember of my recursions skill was that i was goo
Try printing the value of the middle variable.
middle
Best practise dictates that you don't code in "Before function" style debugging messages without any variable output.