Monadic implementation finished (same as non-monadic)