step 9 : code optimization