Added implementation of monadlogic