Added JOINS to include names rather than IDs