Implemented optimized join()