fixed the calculation of the S tables. I added the Atable to early.

Now S should be correct....
Well, as could be seen at the end of the previous commit. I was not really confident that the calculation S was complety bug free and it wasn't.

But now the results are the same as from the mathematica. However some changes where made to the mathematica file. I do not know how big the effect is of these changes.
added an interpolation function.

Hopefully it works.