Massive changes

Some changes I made with help of a friend of mine.