Better testing and join function