implemented join with left and right