Exercise 3.03 only working for simple single pattern