Custom assertion moved to separate file
More standard syntax for pattern matching
Fix type declaration
Problem 2
Problem 3