Refactored `rwg`, made it *much* more Haskell-y