join working but incorrect implementation