Wrote a little mathUtil, also added max stack size as argument to be checked
Merge origin/master