The final version of the code for submission

The final version of the code for submission