Adjusting the gain?

The gain optimization method describe in the post quoted by @jonhawkes2030 is ok.

However in this post, the .docx files from Dropbox are in MS Word format, and fail on some Linux computers.

For this reason, I have subsequently posted these scripts as code within the post I am linking below.

Copy-paste code from the post linked below does not give any formatting problem.