added c++ unique function