Use C++ Exception; Moved calculation code to a function; ...
Merge pull request #1 from DLaboratory/testing

Use C++ Exception; Moved calculation code to a function; ...