Cleaned up and added a join function.