added phpunit framework
added reverse calculation method (untested, formula needs review and tests)