Updated code for previous commit