modified join steps for huge performance gain