porting: work in progress, basic rules scan, much to do