Working on join logic