Upgrade Changes

I have tried to do upgrade changes. But they still need to be worked on.
conflict resolved