old attempt at porting to 0.8.x