code for join