fix n and k