tweaked initialization code