Added randoming for task and punishment.