change logic of pattern2