Adds calculator function. Fixes #3