rewrite of riftwarp