added interrupt and added more initialization code