How are you measuring whether it works? What does work mean? What is your function doing differently from what you need it to do? Do you know what should be different about its behaviour? What are you currently trying to make happen? What is stopping you from doing that?
Perhaps you might even argue that it does work, but doesn’t pass the exercise, in which case the question is something else entirely (but still really important that anyone looking at it understands what the situation is)
If you expand your questions a bit further than “fix” and “work” then you’ll probably find yourself a whole lot closer to the solution before you’ve even asked anything. Also, anyone who might answer has a better chance at understanding the situation.