Index joins

Updated for new type system