Debugging the function....