code passed but there should have been vectorized implementation