The code seems to work as required, but fails all of them. Am I missing something?