Curly braces around case statements in a match clause are never optional
It was calling the wrong length function