Thank you roxxon
I have seen this thread, and in fact I have tried the code suggested there, but the output produced does not match the example given in the book. I compared the codes and I cannot find any big difference (apart from the added missing bits), so a bit confused whether there was any conclusion made about the general validity of the code.
If you are familiar with the problem I would be very happy to hear any further suggestions
with best regards
Feodor.