updated initialization code