Step 4 and code clean up