added calculation method, fixes #23