Updated code for the revision