minor porting