fixed some addresses and added dynamic porting