Updated code with modified chosen