Modified from local init to global