some changes reverted to make it easier to compare
and understand the mdifications