initialization function updated