Updated code pieces