working on porting to rory's engine