Implemetation of raw_join