Moving math to lib
Adding ArgumentException for non numbers