naive alg