figuring out how to join the tables