latest changes from trf4 version integrated and comments addressed