A port of nulljosh's rmv