Made the join tables work better