Final working version with surprise