Wrote natural join function