option monad implementation