Done it with all pattern matching