Why are you throwing away the connectionSource and connectionDest pointers (I assume they're strings) that were passed into your function? And what does the magic value 4 represent?