finished porting work (almost, no reset handling yet)