Added result data type instead of using Maybe monad