Unclassifiable statement error with a function that seems fine

You are missing a contains statement.