almost done porting