Updated code further