functional string calculator