Modified code
Completed