added tailJoin, to do collapse and hardJoin