Updated code