added list pattern matching