fixed intersection() implementation