added all the changes

Add this to 0.7.5 branch if it is good.