More porting, check in original java source