begin porting changes, not ready to test yet.