porting more functions