Updated code snippet