got self-joins to work