Resolve undefined references to K, n and p in function calcLambda