added alternate pattern matching idea