building out the joins