Preloader setup and base functions
Revised file