update join logic
clarify comments