new problem I used pattern matching so my solutions need to be easier