alternative implementation of Calculator.calculate using the Option monad