More changes

R-tested
important changes and things