*fixed order of functions *fixed the slow startup