Used the maybe monad