more primitive and algebra porting