added 'rule 3' collapsing