Added inner and outer joins