Updated code in post