A Huge rewrite of all sripts