code unrunable since monad is not formly introduced and the code in the slides should be partial