extension to 3Sum