first solution, some trouble with contains()