adding preliminary monad implementation based on an online tutorial