replace buggy setdiff1d implementation