Code for Newman method with fine-tuning