changed the left outer joins to inner joins