add case statement for pattern type