distributed naive implementation complete