TONs of changes. More coming later for final polish