added cases for matching and non matching sum