replaced iteration with join