Ok, the bug is mine because the investment calculator works and when I copy&paste your code it also works. I was missing a parameter value is the problem. Sorry for wasting your time! I wish I could say it will be the last time but I doubt it.