Draft implementation of join