building in some code from RIP