Finished recursive pattern matching