using pattern tableaus for result