Final Code

Adding the changes for the final code for reference if need be.